package chattingRoomUpdate;

import java.io.IOException;
import java.net.Socket;
import java.util.Scanner;

/**
 * 将读写两个功能实现分离
 */
public class ChatClientUpdate {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1", 8888);


        System.out.println("请输入你的用户名");
        Scanner scanner=new Scanner(System.in);
        String username = scanner.next();

        new Thread(new ClientSend(socket,username)).start();
        new Thread(new ClientReceive(socket)).start();
    }
}
